package com.zpf.mq;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.time.LocalTime;

@Component
public class MyReceiver {

    @RabbitHandler
    @RabbitListener(queues = "queue0")
    public void process(String msg) {
        System.out.println("Receiver0(hello) -->  : " + msg + " ,now = " + LocalTime.now());
    }

    @RabbitHandler
    @RabbitListener(queues = "queue1")
    public void process1(String msg) {
        System.out.println("Receiver1(world) -->  : " + msg + " ,now = " + LocalTime.now());
    }

}